class Feed::PaymentCreated < Feed
  validates :order_made_payment_id,
    :order_made_id,
    :presence => true

  before_validation do |feed|
    feed.order_item = order_made_payment.order_item
  end

  def code
    ActiveSupport::StringInquirer.new('has_been_payment')
  end

  def short_desc
    "#{order_made.creator_name}于#{
    order_made_payment.payed_on}向【#{
    order_made.factory_name}】<b>下单订做</b>【 #{
    order_made.order_made_count}件】已付款：￥#{format("%.2f",order_made_payment.how_much)}"
  end

  def remark
    order_made_payment.remark
  end

  def related_one
    order_made_payment
  end

  def related_html_id
    "related_order_made_#{order_made_id}"
  end

  def related_type
    "related_order_made"
  end
end
